Firstly, the vlapic bitops need fewer casts.
Secondly, the minimum-alignment check is unnecessary and also breaks
the build (page_info's type_info field has alignment == 1). It is an
unnecessary check because bitops operate on only one bit of the word
they access, so lack of atomicity of the read and writeback does not
matter -- furthermore the LOCKed variants are guaranteed atomic
regardless of alignment.
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
static int vlapic_test_and_set_irr(int vector, struct vlapic *vlapic)
{
- return vlapic_test_and_set_vector(
- vector, (unsigned long *)&vlapic->regs->data[APIC_IRR]);
+ return vlapic_test_and_set_vector(vector, &vlapic->regs->data[APIC_IRR]);
}
static void vlapic_clear_irr(int vector, struct vlapic *vlapic)
{
- vlapic_clear_vector(
- vector, (unsigned long *)&vlapic->regs->data[APIC_IRR]);
+ vlapic_clear_vector(vector, &vlapic->regs->data[APIC_IRR]);
}
static int vlapic_find_highest_irr(struct vlapic *vlapic)
#define CONST_ADDR (*(const volatile long *) addr)
extern void __bitop_bad_size(void);
-#define bitop_bad_size(addr) (min(sizeof(*(addr)), __alignof__(*(addr))) < 4)
+#define bitop_bad_size(addr) (sizeof(*(addr)) < 4)
/**
* set_bit - Atomically set a bit in memory